package licode.unisop.realm.adapter.web;

import licode.unisop.realm.client.api.SiRealmQueryService;
import licode.unisop.realm.client.dto.SiRealmDTO;
import licode.unisop.unilite.result.UniReturnResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 适配RESTFUL接口访问，处理领域的操作
 *
 * @author WR
 */
@RestController
@UniReturnResult
@RequestMapping("/user-api/v1/internal/realm/query")
public class RealmQueryController {

    @Resource
    private SiRealmQueryService siRealmQueryService;

    @PostMapping("/list")
    public List<SiRealmDTO> getRealmList() {
        return siRealmQueryService.getRealmList();
    }
}
